from django.conf.urls.defaults import *
from django.conf import settings
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Example:
    # (r'^buildbotweb/', include('buildbotweb.foo.urls')),

    # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
    # to INSTALLED_APPS to enable admin documentation:
    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    (r'^testruns[/]?$', 'buildbotweb.buildbot.views.testrunsindex'),
    (r'^testruns/(?P<testrun_id>\d+)[/]?$', 'buildbotweb.buildbot.views.testrunsdetail'),
    (r'^testsuite_testruns/(?P<testsuite_id>\d+)[/]?$', 'buildbotweb.buildbot.views.testrunsindex'),
    
    (r'^testsuites[/]?$', 'buildbotweb.buildbot.views.testsuiteindex'),
    (r'^testsuites/(?P<testsuite_id>\d+)[/]?$', 'buildbotweb.buildbot.views.testsuitedetails'),
    
    (r'^testsuiteruns[/]?$', 'buildbotweb.buildbot.views.running_testsuites'),
    (r'^testsuiteruns/(?P<tsr_id>\d+)[/]?$', 'buildbotweb.buildbot.views.testsuiterun_details'),
    
    (r'^testresults/(?P<testid>\d+)[/]?$', 'buildbotweb.buildbot.views.testresults'),
    (r'^testsuite_testresults/(?P<testsuiteid>\d+)/(?P<testid>\d+)[/]?$', 'buildbotweb.buildbot.views.testresults'),
    (r'^testresults[/]?$', 'buildbotweb.buildbot.views.testresultsindex'),
   
    (r'^tests[/]?$', 'buildbotweb.buildbot.views.testsindex'),
     

    (r'^results[/]?$', 'buildbotweb.buildbot.views.resultsindex'),
    (r'^results/(?P<suiteid>\d+)[/]?$', 'buildbotweb.buildbot.views.results'),
    (r'^results/all[/]?$', 'buildbotweb.buildbot.views.allresults'),
    #(r'^media/css/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT }),
    #(r'^media/js/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT }),
    # Uncomment the next line to enable the admin:
    
    (r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT }),
    (r'^admin/(.*)', admin.site.root),
    (r'^$', 'buildbotweb.buildbot.views.main', {'site_url': settings.SITE_URL}),
)
